package com.tdd.api.server.base.util;

import com.tdd.api.server.base.exception.BusinessException;
import com.tdd.api.server.base.returns.RespCode;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.Objects;

/**
 * @author TDD
 * @version V1.0.0
 * @description: ${Description}
 * @date 2020/3/12 15:48
 * @copyright Copyright © 2019 
 */
@Component
@Slf4j
public class AssertUtil {

    public void assertNull(Object object){
        if (Objects.isNull(object)||object==null) {
            log.error("查询对象为空");
            throw new BusinessException(RespCode.OBJECT_NOT_EXISTED,"查询结果为空");
        }
    }
}
